﻿<%@ page title="" language="C#" masterpagefile="~/MasterPages/MasterPage.master" autoeventwireup="true" inherits="Pages_Public_Registration, BtcHousing" stylesheettheme="ServerControls" %>
<%@ Import Namespace="App.Core.Extensions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server">
    <script language="javascript" type="text/javascript">
        var _countryIDBangladesh = <%= ConfigReader.CountryIDOfBangladesh %>;
           
        var _SuccessHtmlForIndividual = 'You have successfully registered with <%= ConfigReader.ProviderCompany %> <a href="/Pages/Public/Login.aspx">Click Here</a> to login.';     
        function ValidateInterestSelection(sender, args) {
            if ($("input[name='chkInterestedProperty']:checked").length > 0)
                args.IsValid = true;
            else
                args.IsValid = false;
        }
        function ValidateIAgree(sender, args) {
            if ($('#<%=chkIAgree.ClientID %>').is(':checked'))
                args.IsValid = true;
            else
                args.IsValid = false;
        }
        var _Individual = null;
        function PrepareIndividualObject() {            
            _Individual = new App.CustomEntity.Individual();
            _Individual.Email = $('#<%= txtEmail.ClientID%>').val();
            _Individual.Name = $('#<%= txtName.ClientID%>').val();
            _Individual.Password = $('#<%= txtPassword.ClientID%>').val();
            _Individual.Phone = $('#<%= txtPhone.ClientID%>').val();
            _Individual.ResidenceCountryID = $('#<%= ddlPreferredCountry.ClientID%>').val();
            _Individual.Address = $('#<%= txtAddress.ClientID%>').val();
            _Individual.ZipCode = $('#<%= txtZipCode.ClientID%>').val();
            _Individual.InterestedInLoan = $('#<%= chkInterestedInLoan.ClientID%>').is(':checked');
            var selections = '';
            $("#<%= divPropertyTypes.ClientID%>  input[type='checkbox']:checked").each(function (i, obj) {
                if (i == 0)
                    selections = $(this).val();
                else
                    selections += ',' + $(this).val()
            });
            _Individual.InterestedOn = selections;

            var _cIDOfBangladesh = <%= ConfigReader.CountryIDOfBangladesh %>;            
            if(_cIDOfBangladesh == _Individual.ResidenceCountryID ){                
                _Individual.PreferredCityID = $('#<%= ddlPreferredCity.ClientID%>').val();
                selections = '';
                $("input[name='chkPreferredZone']:checked").each(function (i, obj) {
                    if (i == 0)
                        selections = $(this).val();
                    else
                        selections += ',' + $(this).val()
                });
                //alert(selections);
                _Individual.PreferredZones = selections;
            }else{                
                _Individual.CityName = $('#<%= txtCityName.ClientID%>').val();       
                _Individual.PreferredZones = $('#<%= txtPreferredZones.ClientID%>').val();
             }
            
            //alert("TEST11");
            _Individual.Feedback = $('#<%= txtFeedback.ClientID %>').val();
        }        
        function RegisterUser(validationGroup) {
            //alert("Start....");
            if (Page_ClientValidate(validationGroup)) {
                //alert("Validate....");
                ShowProgressAnimation('btnNextStep2', ($('#btnNextStep2').width() + 20), 0);             
                PrepareIndividualObject();
                PageMethods.RegisterIndividual(_Individual, RegisterIndividual_Success, OnAjax_Error, OnAjax_TimeOut);
            }
        }
        function RegisterIndividual_Success(result) {
            //alert("Success....");
            HideProgressAnimation();
            if (result == 1)
            {
                $('#divBusinessSummary').html(_SuccessHtmlForIndividual);
                MoveToStep(5, 5, '');
            }
            else if (result == -1) {
                $('#<%= txtEmail.ClientID%>').focus();
                alert('This email is already taken choose another');
            }
            else if (result == -2) {
                //$('#<%= txtEmail.ClientID%>').focu();
                alert('This Login Name is already taken choose another');
            }
            else if (result == -3) {
                alert('There is some problem in registration. Please try after some time.');
            }
        }
        var _Customer = null;
        function PrepareCustomerObject() {
            _Customer = new App.CustomEntity.Cusomer();
            _Customer.CompanyName = $('#<%=txtCompanyName.ClientID %>').val();
            var parentBusinessTypeID = $("input[name='rdbDBusinessType']:checked").val();            
            if(parentBusinessTypeID == _DeveloperBusinessTypeID)
                _Customer.BusinessTypeID = parentBusinessTypeID;
            else            
                 _Customer.BusinessTypeID = $('#<%= ddlBusinessTypeID.ClientID%>').val();

            _Customer.IsRehabMember = $('#<%= chkIsRehabMember.ClientID%>').is(':checked');
            _Customer.ContactName = $('#<%=txtContactName.ClientID %>').val();
            _Customer.UserName = $('#<%=txtUserName.ClientID %>').val();
            _Customer.ContactEmail = $('#<%=txtContactEmail.ClientID %>').val();
            _Customer.Password = $('#<%=txtContactPassword.ClientID %>').val();
            _Customer.Phone = $('#<%=txtContactPhone.ClientID %>').val();
            _Customer.Fax = $('#<%=txtContactFax.ClientID %>').val();
            _Customer.Feedback = $('#<%=txtComments.ClientID %>').val();
            _Customer.Address = $('#<%=txtCommonAddress.ClientID %>').val();
            _Customer.BusinessDetails = $('#<%=txtBusinessDetails.ClientID %>').val();
        }
        function RegisterCustomer() {
            if (Page_ClientValidate('Step4')) {
                ShowProgressAnimation('btnStep4Next', ($('#btnStep4Next').width() + 40), 0);
                PrepareCustomerObject();
                PageMethods.RegisterCompany(_Customer, RegisterCustomer_Success, OnAjax_Error, OnAjax_TimeOut);
            }
        }
        function RegisterCustomer_Success(result) {
            HideProgressAnimation();
            if (result == 1)
            {
                $('#divBusinessSummary').html('A Verification Email has been sent to <b>' + _Customer.ContactEmail + '</b>. Please click on the activation link given in the email to Activate your account. <br/><br/>Thanks for registering with us.');
                MoveToStep(5, 5, '');
            }
            else if (result == -1) {
                $('#<%=txtContactEmail.ClientID %>').focus();
                alert('The email is already taken. Please choose another.');
            }
            else if (result == -2) {
                $('#<%=txtUserName.ClientID %>').focus();
                alert('The User Name is already taken. Please choose another.');
            }
            else if (result == -3) {                
                alert('There is some problem in registration. Please try after some time.');
            }
        }
        function btnNextStep1_Click() {
            //alert('Move');
            if ($('#<%=rdbIndividual.ClientID %>').is(':checked'))
                MoveToStep(2, 5, '');
            else
                MoveToStep(3, 5, '');
        }
        function ValidateBusinessTypeSelection(sender, args){
            var parentBusinessTypeID = $("input[name='rdbDBusinessType']:checked").val();
            if(parentBusinessTypeID == _DeveloperBusinessTypeID)
                args.IsValid = true;
            else
                if(args.Value.length > 0 )
                    args.IsValid = true;
                else
                    args.IsValid = false;
        }
        var _DeveloperBusinessTypeID = <%= ConfigReader.DeveloperBusinessTypeID %>;
        function GetBusinessCategories(btnElement) {
            var parentBusinessTypeID = $("input[name='rdbDBusinessType']:checked").val();
            //alert('parent:' + parentBusinessTypeID + ' Dev' + _DeveloperBusinessTypeID);
            if(parentBusinessTypeID == _DeveloperBusinessTypeID){
                $('#trBusinessType').hide();
                $('#trIsRehabMember').show();
                MoveToStep(4, 5, 'Step3');
            }
            else
            {
                $('#trIsRehabMember').hide();
                $('#trBusinessType').show();
                $('#<%= ddlBusinessTypeID.ClientID%>').find('option').remove();
                if (parentBusinessTypeID.length > 0) {
                    ShowProgressAnimation($(btnElement).attr('id'), $(btnElement).width() + 5, 0);
                    AjaxService.GetChildBusinessTypes(parentBusinessTypeID, GetBusinessCategories_Success, OnAjax_Error, OnAjax_TimeOut);
                }
            }
        }
        function GetBusinessCategories_Success(result) {
            HideProgressAnimation();
            var types = eval(result);
            if (types != null && types.length > 0) {
                $('#<%=ddlBusinessTypeID.ClientID%>').append($("<option></option>").attr("value", '').text(''));
                for (i = 0; i < types.length; i++) {
                    var type = types[i];
                    $('#<%=ddlBusinessTypeID.ClientID%>').append($("<option></option>").attr("value", type.ID).text(type.ShortName));
                }
            }
            MoveToStep(4, 5, 'Step3');
        }
        
        $(document).ready(function () {
            var _CountryIDOfBangladesh = <%= ConfigReader.CountryIDOfBangladesh %>;
            var ddlPreferredCountry = $('#<%= ddlPreferredCountry.ClientID %>');
            var ddlCity = $('#<%= ddlPreferredCity.ClientID %>');
            $('#rowNoneBdPreferredCity').hide();
            $('#trNonBdPreferredZones').hide();

            $(ddlPreferredCountry).change(function(){
                
                if(ddlPreferredCountry.val() == _CountryIDOfBangladesh ){                    
                    GetCitiesByCountry($(this), ddlCity);
                    $('#rowNoneBdPreferredCity').hide();
                    $('#trNonBdPreferredZones').hide();
                    $('#trBdPreferredCity').show();
                    $('#trBdPreferredZones').show();
                }else if(ddlPreferredCountry.val()>0){ // Other than bangladesh
                    $('#rowNoneBdPreferredCity').show();
                    $('#trNonBdPreferredZones').show();
                    $('#trBdPreferredCity').hide();
                    $('#trBdPreferredZones').hide();
                }else{  // If nothing selected any Country
                    $('#rowNoneBdPreferredCity').hide();
                    $('#trNonBdPreferredZones').hide();
                    $('#trBdPreferredCity').show();
                    $('#trBdPreferredZones').show();
                }
                
            });
            $(ddlCity).change(function () {
                GetPreferredZones($(this));
            });
                                        
        });
        
        function ValidateCitySelection(sender, args) {
            var ddlPreferredCountry = $('#<%= ddlPreferredCountry.ClientID %>').val();            
            if(ddlPreferredCountry==_countryIDBangladesh){
                var city = $('#<%= ddlPreferredCity.ClientID %>').val();                
                if(city==''||city==undefined||city==null) 
                    args.IsValid = false;
                else
                    args.IsValid = true;
            }else
                args.IsValid = true;    
        }

        function ValidatAreaSelectionForBD(sender, args) {            
            var ddlPreferredCountry = $('#<%= ddlPreferredCountry.ClientID %>').val();            
            if(ddlPreferredCountry==_countryIDBangladesh){                
                if($("input[name='chkPreferredZone']:checked").length > 0)
                    args.IsValid = true;
                else
                    args.IsValid = false;
            }else
                args.IsValid = true;    
        }

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">    
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/Services/AjaxService.asmx" />
        </Services> 
    </asp:ScriptManagerProxy>

    <h4>Become a Member</h4>    
    <div id="divMessage" class="ErrorMessageBox" runat="server" visible="false" style="display:block; margin-bottom:15px;"></div>
    
    <div class="clearboth"></div>
    
    <asp:Panel ID="pnlFormContainer" runat="server">
        <%--First Step--%>        
        <div id="divStep_1" class="WizardContainer" style="display:block;">
            <div class="StepHeaderContainer">
                <div class="StepHeading"><asp:Label ID="lblMemberShipType" runat="server" Text="Membership Type"></asp:Label></div>
                <div class="StepSubHeading"><asp:Label ID="Label1" runat="server" Text="Select Your Membership Type"></asp:Label></div>
            </div>
            <div class="StepBody">
                <div class="ContainerHoverEffect">
                    <div><asp:RadioButton ID="rdbIndividual" GroupName="UserType" runat="server" Text="<b>I am an Individual</b>" Checked="true" /></div>
                    <div style="margin:4px 0px 10px 20px;">
                        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's 
                        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to 
                        make a type specimen book.
                    </div>
                </div>

                <div class="ContainerHoverEffect" style="margin-top:20px;">
                    <div><asp:RadioButton ID="rdbBusiness" GroupName="UserType" runat="server" Text="<b>I am a Business Representative</b>" /></div>
                    <div style="margin:4px 0px 10px 20px;">
                        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's 
                        standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to 
                        make a type specimen book.
                    </div>
                </div>
            </div>
            <div class="StepButtonContainer">
                <input type="button" class="ButtonCommon" value="Next" onclick="btnNextStep1_Click();" />
            </div>
        </div>
        <%--Customer Information Group Box End--%>

        <%--Second Step [Individual] Registration Start--%>
        <div id="divStep_2" class="WizardContainer" style="display:none;">
           <div class="StepHeaderContainer">
                <div class="StepHeading"><asp:Label ID="lblSignUp" runat="server" Text="Sign Up as Individual"></asp:Label></div>
                <div class="StepSubHeading"><asp:Label ID="lblSignUpSubHeading" runat="server" Text=""></asp:Label></div>
            </div>
            <div class="StepBody">
                <div>Fields marked with an asterisk (<span class="requiredMark">*</span>) are required.</div>
                <%--Personal Info--%>
                <div class="GroupBox">
                    <div class="GroupHeaderOverlay">Personal Info</div>
                    <table class="StepForm" cellpadding="3" cellspacing="0" style="width:100%;">
                        <colgroup>
                            <col style="width:19%;" />
                            <col style="width:51%;" />
                            <col />
                        </colgroup>

                        <tr>
                            <td><asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtEmail" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvEmail" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtEmail" ValidationGroup="Step2"
                                    ErrorMessage="Please enter an Email.">
                                </asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    ControlToValidate="txtEmail" Display="Dynamic" SetFocusOnError="true"
                                    ErrorMessage="Please enter a valid Email address."
                                    ValidationGroup="Step2">
                                </asp:RegularExpressionValidator>
                            </td>
                            <td>You will use this email as User Name to Log In/Sign In to this site.</td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblName" runat="server" Text="Name"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtName" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtName" ValidationGroup="Step2"
                                    ErrorMessage="Please enter your name.">
                                </asp:RequiredFieldValidator>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPassword" runat="server" Text="Password"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtPassword" ValidationGroup="Step2"
                                    ErrorMessage="Please enter your Password.">
                                </asp:RequiredFieldValidator>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblConfirmPassword" runat="server" Text="Confirm Password"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtConfirmPassword" TextMode="Password" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtConfirmPassword" ValidationGroup="Step2"
                                    ErrorMessage="Please Confirm your Password.">
                                </asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="cvConfirmPassword" runat="server"                                    
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtConfirmPassword" ControlToCompare="txtPassword" Operator="Equal" 
                                    ValidationGroup="Step2"
                                    ErrorMessage="Two Password does not match.">
                                </asp:CompareValidator>
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPhone" runat="server" Text="Phone"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtPhone" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtPhone" ValidationGroup="Step2"
                                    ErrorMessage="Please enter your Phone number.">
                                </asp:RequiredFieldValidator>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                </div>

                <%--Present Address--%>
                <%--<div class="GroupBox">
                    <div class="GroupHeaderOverlay">Present Address</div>
                    <table class="StepForm" cellpadding="3" cellspacing="0">
                        <colgroup>
                            <col style="width:27%;" />
                            <col />
                        </colgroup>
                        <tr>
                            <td><asp:Label ID="lblCountry" runat="server" Text="Country"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="ddlCountry" runat="server"></asp:DropDownList>                                
                            </td>
                        </tr>                    
                        <tr>
                            <td><asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtAddress" TextMode="MultiLine" MaxLength="250" runat="server"></asp:TextBox>                                
                            </td>
                        </tr>
                    </table>
                </div>--%>

                <%--Your Interest--%>
                <div class="GroupBox">   
                    <div class="GroupHeaderOverlay">Your Interest</div>             
                    <table class="StepForm" cellpadding="3" cellspacing="0">
                        <colgroup>
                            <col style="width:27%;" />
                            <col />
                        </colgroup>
                        <tr>
                            <%--<td>&nbsp;</td>--%>
                            <td colspan="2"><asp:CheckBox ID="chkInterestedInLoan" runat="server" Text="I am Interested In Loan or Financing"></asp:CheckBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPropertyType" runat="server" Text="Interested on"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <div id="divPropertyTypes" runat="server"></div>
                                <asp:CustomValidator ID="CustomValidator1" runat="server"
                                    Display="Dynamic" SetFocusOnError="true" ClientValidationFunction="ValidateInterestSelection"
                                    ValidationGroup="Step2" ValidateEmptyText="true"
                                    ErrorMessage="Please Select few of your Interests.">
                                </asp:CustomValidator>
                                <%--<asp:CheckBoxList ID="chklPropertyTypes" runat="server" RepeatDirection="Horizontal" RepeatColumns="2"></asp:CheckBoxList>--%>
                                <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="chklPropertyTypes" ValidationGroup="Step2"
                                    ErrorMessage="Please Select few of your Preferred Property.">
                                </asp:RequiredFieldValidator>--%>
                            </td>
                        </tr> 
                        <tr>
                            <td><asp:Label ID="lblCountry" runat="server" Text="Preferred Country"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:DropDownList ID="ddlPreferredCountry" runat="server"></asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvPreferredCountry" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="ddlPreferredCountry" ValidationGroup="Step2"
                                    ErrorMessage="Please Select your Preferred Country.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>                        
                        <tr id="rowNoneBdPreferredCity">
                            <td><asp:Label ID="lblNoneBdPreferredCity" runat="server" Text="Preferred City"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtCityName" runat="server" MaxLength="150"></asp:TextBox>
                                <%--<asp:RequiredFieldValidator ID="rfvCityName" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtCityName" ValidationGroup="Step2"
                                    ErrorMessage="Please enter city name.">
                                </asp:RequiredFieldValidator>--%>
                            </td>                            
                        </tr>
                                               
                        <tr id="trBdPreferredCity">
                            <td><asp:Label ID="lblPreferredCity" runat="server" Text="Preferred City"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:DropDownList ID="ddlPreferredCity" runat="server"></asp:DropDownList>
                                <asp:CustomValidator ID="rfvPreferredCity" runat="server"
                                    Display="Dynamic" SetFocusOnError="true" ClientValidationFunction="ValidateCitySelection" 
                                    ValidationGroup="Step2" ValidateEmptyText="true"
                                    ErrorMessage="Please enter your Preferred City.">
                                </asp:CustomValidator>
                            </td>
                        </tr>
                        <tr id="trNonBdPreferredZones">
                            <td><asp:Label ID="Label9" runat="server" Text="Preferred Area"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtPreferredZones" runat="server" MaxLength="200"></asp:TextBox>
                                <%--<asp:RequiredFieldValidator ID="rfvPreferredZones" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtPreferredZones" ValidationGroup="Step2"
                                    ErrorMessage="Please enter preferred area.">
                                </asp:RequiredFieldValidator>--%>
                            </td>                            
                        </tr> 
                        <tr id="trBdPreferredZones">
                            <td><asp:Label ID="lblPreferredArea" runat="server" Text="Preferred Area"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <div id="divPreferredArea" class="CheckBoxListContainer">
                                    
                                </div>
                                <asp:CustomValidator ID="cvPreferredArea" runat="server"
                                    Display="Dynamic" SetFocusOnError="true" ClientValidationFunction="ValidatAreaSelectionForBD"
                                    ValidationGroup="Step2" ValidateEmptyText="true"
                                    ErrorMessage="Please Select your Preferred Area.">
                                </asp:CustomValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblZipCode" runat="server" Text="Zip Code"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtZipCode" runat="server" MaxLength="30"></asp:TextBox>                                
                            </td>                            
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblAddress" runat="server" Text="Address"></asp:Label></td>
                            <td><asp:TextBox ID="txtAddress" runat="server"></asp:TextBox></td>
                        </tr>                        
                        <tr>
                            <td><asp:Label ID="lblFeedback" runat="server" Text="Feedback"></asp:Label></td>
                            <td><asp:TextBox ID="txtFeedback" TextMode="MultiLine" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>                            
                            <td colspan="2">
                                <asp:CheckBox ID="chkIAgree" runat="server" Text=""></asp:CheckBox> <label for="<%= chkIAgree.ClientID %>">I Agree With <%= ConfigReader.ProviderCompany %></label> <a href="/Pages/Public/ShowContent.aspx?<%=AppConstants.QueryString.ID %>=<%=ConfigReader.ContentIDOfTermsOfUse %>" target="_blank">Terms of Use</a>
                                <asp:CustomValidator ID="CustomValidator2" runat="server"
                                    Display="Dynamic" SetFocusOnError="true" ClientValidationFunction="ValidateIAgree"
                                    ValidationGroup="Step2" ValidateEmptyText="true"
                                    ErrorMessage="<br/>You must be agree with our Terms of Use.">
                                </asp:CustomValidator>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            
            <div class="StepButtonContainer">
                <input type="button" class="ButtonInActive" value="Back" onclick="MoveToStep(1, 5, '');" />
                <input type="button" id="btnNextStep2" class="ButtonCommon" value="Finish" onclick="RegisterUser('Step2');" />
            </div>
        </div>

        <%--Second Step [Individual] Registration End --%>


        <%--Third Step Business Provider Types Start--%>
        <div id="divStep_3" class="WizardContainer" style="display:none;">
            <div class="StepHeaderContainer">
                <div class="StepHeading"><asp:Label ID="Label2" runat="server" Text="Your Business"></asp:Label></div>
                <div class="StepSubHeading"><asp:Label ID="Label3" runat="server" Text="Select the type of Business that you do."></asp:Label></div>
            </div>
            <div class="StepBody">
                <div>
                    <%   
                        int counter = 0;                     
                        foreach (App.Data.BusinessType businessType in _BusinessTypes)
                        {
                            %>
                            <div class="ContainerHoverEffect">
                                <div>
                                    <input type="radio" name="rdbDBusinessType" id="rdbDBusinessType_<%= businessType.ID %>" value="<%= businessType.ID %>" <% if(counter == 0){ %> checked="checked"<%} %>/> <label for="rdbDBusinessType_<%= businessType.ID %>"><b><%= businessType.LongName.HtmlEncode() %></b></label>              
                                </div>
                                <div style="margin:4px 0px 10px 25px;">
                                    <%= businessType.Description.HtmlEncode()%>
                                </div>
                            </div>
                            <%
                            counter++;
                        } 
                    %>
                </div>
            </div>
            <div class="StepButtonContainer">
                <input type="button" class="ButtonInActive" value="Back" onclick="MoveToStep(1, 5, '');" />
                <input type="button" id="btnNextStep3" class="ButtonCommon" value="Next" onclick="GetBusinessCategories(this);" />
            </div>
        </div>
        <%--Third Step Business Provider Types End--%>


        <%--Fourth Step Developer Registration Start--%>
        <div id="divStep_4" class="WizardContainer" style="display:none;">
            <div class="StepHeaderContainer">
                <div class="StepHeading"><asp:Label ID="Label4" runat="server" Text="Become a Registered Member"></asp:Label></div>
                <div class="StepSubHeading"><asp:Label ID="Label5" runat="server" Text="Pelase provide following information to become a registered member."></asp:Label></div>
            </div>
            <div class="StepBody">
                <div>Fields marked with an asterisk (<span class="requiredMark">*</span>) are required.</div>
                <%--Company Information Start --%>
                <div class="GroupBox">
                    <div class="GroupHeaderOverlay">Contact Person</div>
                    <table class="StepForm" cellpadding="3" cellspacing="0">
                        <colgroup>
                            <col style="width:27%;" />
                            <col />
                        </colgroup>                        
                        <tr>
                            <td><asp:Label ID="lblContactName" runat="server" Text="Contact Name"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtContactName" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactName" ValidationGroup="Step4"
                                    ErrorMessage="Please enter Name.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblUserName" runat="server" Text="User Name"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtUserName" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtUserName" ValidationGroup="Step4"
                                    ErrorMessage="Please enter User Name.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblContactPassword" runat="server" Text="Password"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtContactPassword" TextMode="Password" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactPassword" ValidationGroup="Step4"
                                    ErrorMessage="Please enter a Password.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblContactConfirmPassword" runat="server" Text="Confirm Password"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtContactConfirmPassword" TextMode="Password" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactConfirmPassword" ValidationGroup="Step4"
                                    ErrorMessage="Please Confirm your Password.">
                                </asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="CompareValidator1" runat="server"                                    
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactConfirmPassword" ControlToCompare="txtContactPassword" Operator="Equal" 
                                    ValidationGroup="Step4"
                                    ErrorMessage="Two Password does not match.">
                                </asp:CompareValidator>
                            </td>
                        </tr>

                        <tr>
                            <td><asp:Label ID="lblContactPhone" runat="server" Text="Phone"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtContactPhone" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactPhone" ValidationGroup="Step4"
                                    ErrorMessage="Please enter Phone number.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblContactEmail" runat="server" Text="Email"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtContactEmail" runat="server" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactEmail" ValidationGroup="Step4"
                                    ErrorMessage="Please enter Email.">
                                </asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="reContactEmail" runat="server" 
                                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    ControlToValidate="txtContactEmail" Display="Dynamic" SetFocusOnError="true"
                                    ErrorMessage="Please enter a valid Email address."
                                    ValidationGroup="Step4">
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblFax" runat="server" Text="Fax"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtContactFax" runat="server" MaxLength="50"></asp:TextBox>
                                <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtContactEmail" ValidationGroup="Step4"
                                    ErrorMessage="Please enter Email.">
                                </asp:RequiredFieldValidator>--%>
                            </td>
                        </tr>
                    </table>
                </div>                
                
                
                <div class="GroupBox">
                    <div class="GroupHeaderOverlay">Company Information</div>
                    <table class="StepForm" cellpadding="3" cellspacing="0">
                        <colgroup>
                            <col style="width:30%;" />
                            <col />
                        </colgroup>

                        <tr>
                            <td><asp:Label ID="lblCompanyName" runat="server" Text="Company Name"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtCompanyName" runat="server" MaxLength="150"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtCompanyName" ValidationGroup="Step4"
                                    ErrorMessage="Please enter Company Name.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr id="trIsRehabMember">
                            <td><asp:Label ID="Label8" runat="server" Text="Do you have Rehab?"></asp:Label></td>                            
                            <td style="margin-left:0px;padding-left:0px;text-align:left;"><asp:CheckBox ID="chkIsRehabMember" runat="server"></asp:CheckBox></td>
                        </tr>
                        <tr id="trBusinessType">
                            <td>Your Business Type<span class="requiredMark">*</span></td>
                            <td>
                                <asp:DropDownList ID="ddlBusinessTypeID" runat="server"></asp:DropDownList>
                                <asp:CustomValidator ID="RequiredFieldValidator12" runat="server"
                                    Display="Dynamic" SetFocusOnError="true" ValidateEmptyText="true"
                                    ClientValidationFunction="ValidateBusinessTypeSelection"
                                    ControlToValidate="ddlBusinessTypeID" ValidationGroup="Step4"
                                    ErrorMessage="Please Select your Compny's Business Type.">
                                </asp:CustomValidator>
                            </td>
                        </tr
                        

                        <tr>
                            <td><asp:Label ID="lblBusinessDetails" runat="server" Text="Business Details"></asp:Label></td>
                            <td><asp:TextBox ID="txtBusinessDetails" TextMode="MultiLine" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblCommonAddress" runat="server" Text="Address"></asp:Label></td>
                            <td><asp:TextBox ID="txtCommonAddress" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblComments" runat="server" Text="Feedback"></asp:Label></td>
                            <td><asp:TextBox ID="txtComments" TextMode="MultiLine" runat="server"></asp:TextBox></td>
                        </tr>
                        <%--<tr>
                            <td><asp:Label ID="lblCompanyAddress" runat="server" Text="Name"></asp:Label><span class="requiredMark">*</span></td>
                            <td>
                                <asp:TextBox ID="txtCompanyAddress" runat="server" TextMode="MultiLine" MaxLength="150"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvCompanyAddress" runat="server"
                                    Display="Dynamic" SetFocusOnError="true"
                                    ControlToValidate="txtCompanyAddress" ValidationGroup="Step4"
                                    ErrorMessage="Please enter the address of your company.">
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>--%>
                    </table>
                </div>

                <%--Company Information End--%>
            </div>
            <div class="StepButtonContainer">
                <input type="button" class="ButtonInActive" value="Back" onclick="MoveToStep(3, 6, '');" />
                <input id="btnStep4Next" type="button" class="ButtonCommon" value="Finish" onclick="RegisterCustomer();" />
            </div>
        </div>
        <%--Fourth Step Developer Registration End--%>

        <%-- Fifth Step Summary Start --%>
        <div id="divStep_5" class="WizardContainer" style="display:none;">
            <div class="StepHeaderContainer">
                <div class="StepHeading"><asp:Label ID="Label6" runat="server" Text="Registration Successful"></asp:Label></div>
                <div class="StepSubHeading"><asp:Label ID="Label7" runat="server" Text="Registration Summary."></asp:Label></div>
            </div>
            <div class="StepBody">                
                <div id="divIndividualSummary"></div>
                <div id="divBusinessSummary">
                    
                </div>
            </div>
            <div class="StepButtonContainer" style="height:20px;">
                <%--<input type="button" class="ButtonInActive" value="Back" onclick="MoveToStep(4, 6, '');" />
                <input type="button" class="ButtonCommon" value="Next" onclick="MoveToStep(6, 6, 'Step4');" />--%>
            </div>
        </div>
        <%--Fifth Step Summary End--%>
        
        <%--<div class="ButtonContainer">  
            <input type="button" onclick="RegisterUser('Tutul');" value="Test AJAX" />                               
        </div>--%>
   </asp:Panel> 
</asp:Content>

